package com.java.demo;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2023-11-14
 * Time:16:12
 * Text：
 */
@Component
public class Users {
    @Bean(name="user")
    @Scope("prototype")   //原型模式|多例模式

    public User getUser(){
        User user = new User();
        user.setId(666);
        user.setName("孙猴子");
        return user;
    }
}
